/* iot-platform/assets/css/table.css */

/* --- 筛选/操作栏 --- */
.table-actions-bar {
    display: flex;
    flex-wrap: wrap; /* 在小屏幕上可以换行 */
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.table-actions-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-actions-bar .actions-group {
    margin-left: auto; /* 将操作按钮推到右侧 */
    display: flex;
    gap: 8px;
}

/* --- 表格容器和主体 (支持固定列/头) --- */
.table-container {
    width: 100%;
    flex-grow: 1; /* 让表格容器填满父级 */
    overflow: auto; /* 关键：让表格本身可以滚动 */
}
.data-table {
    width: 100%;
    border-collapse: separate; /* separate对于sticky更可靠 */
    border-spacing: 0;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    white-space: nowrap; /* 防止内容换行 */
    background: #fff; /* 为sticky的列/头提供背景色，防止内容穿透 */
}
.data-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #333;
    position: sticky; /* 固定表头 */
    top: 0;
    z-index: 2;
}
.data-table tbody tr:hover td { /* 悬浮时整行变色 */
    background-color: #fafafa;
}

/* 固定操作列样式 */
.data-table th.sticky-right,
.data-table td.sticky-right {
    position: sticky;
    right: 0;
    z-index: 1;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}
/* 表头中的固定列需要更高的z-index */
.data-table th.sticky-right {
    z-index: 3;
}
/* 鼠标悬浮时，固定列也需要变色 */
.data-table tbody tr:hover td.sticky-right {
    background-color: #fafafa;
}

.data-table .action-links a {
    margin-right: 12px;
}
.data-table .action-links a:last-child {
    margin-right: 0;
}

/* --- 分页栏 (支持固定) --- */
.pagination-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 16px 24px; /* 增加左右padding以对齐内容 */
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0; /* 防止被压缩 */
    margin: 0 -24px; /* 抵消父级.card-body-table的左右padding，使其通栏 */
}
.pagination-bar .total-count {
    margin-right: auto;
    color: #8c8c8c;
}
.pagination-bar .page-nav button, .pagination-bar .page-nav span {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    border: 1px solid #d9d9d9;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 4px;
}
.pagination-bar .page-nav button:hover {
    border-color: #1890ff;
    color: #1890ff;
}
.pagination-bar .page-nav button.active {
    border-color: #1890ff;
    color: #1890ff;
    font-weight: 600;
}
.pagination-bar .page-size-selector {
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}
.pagination-bar .jump-input {
    width: 40px;
    height: 32px;
    text-align: center;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}